home *** CD-ROM | disk | FTP | other *** search
- /*
- * The original copyright owners of the accompanying source code files have
- * agreed to place such code into the public domain. Accordingly, anyone
- * who receives or obtains a copy of such source code is freely entitled to
- * reproduce, use and otherwise exploit such code (including the right to
- * make derivative works), at his/her own risk and expense, without any
- * obligation or liability to the original copyright owners.
- *
- * We would appreciate (but do not require) that the following message be
- * included in any derivative works:
- *
- * "Portions of this program were developed by Peter Broadwell, Rob Myers
- * and Robin Schaufler while working in Silicon Valley."
- *
- * The accompanying source code files and related documentation materials
- * are distributed on an "AS IS" basis, without any warranties or
- * guarantees of any kind. All implied warranties, including the implied
- * warranties of merchantability and of fitness for any particular purpose,
- * are expressly disclaimed.
- */
- #include "gl.h"
- #include "geom.h"
- #include "selectors.h"
- #include "class.h"
- #include "classIds.h"
- #include "mbox.h"
- #include "individual.h"
- #include "behavior.h"
- #include "doers.h"
-
- #include "pebbles.h"
- #include "colors.h"
-
- extern class indivClass;
- model mica, granite, phosphorous, magnesium, calcium;
- extern char *floorinit();
-
- fcnTable pebbleTable[] = {
- INIT, floorinit,
- EOTABLE,
- };
-
- class pebbleClass = {
- &indivClass,
- pebbleTable,
- sizeof(pebbles),
- PEBBLES,
- };
-
- pebbles pebbleTemplate = {
- /* inst */
- &pebbleClass, /* myClass pointer */
- NULL, /* classFunctions */
- 0, /* nFunctions */
- /* mailbox */
- NULL, /* subscribers */
- NULL, /* subscribedTo */
- /* individual */
- {000,000,-5000}, /* position */
- {0,0,0}, /* lastPosition */
- {1,0,0}, /* delta */
- {0,0,0}, /* velocity */
- {0,0,0}, /* avelocity */
- {0,0,0}, /* acceleration */
- 1.0, /* speed */
- {0,0,10}, /* heading */
- {0,900,0}, /* rotation */
- {0,0,0}, /* influence */
- 1.0, /* scale */
- &mica, /* model */
- NULL, /* flags */
- NULL, /* curVars */
- NULL, /* controls */
- /* pebble */
- {0,0,0}, /* floor */
- };
-
- point pebblePoints[] = {
- { 0, 0, 0, }, /* gratuitous vertex 0 */
- { 50, 100, 00, },
- { 100, -50, 00, },
- { -50, -150, 00, },
- { -150, -100, 00, },
- { -100, 50, 00, },
- };
- long pebbleVertices[] = {
- 5,4,3,2,1,0,
- 0,
- };
-
-
- model calcium = {
- NULL, /* next model segment */
- NULL, /* child model segments */
- NULL, /* geometry compiled yet? */
- (Object)&calcium, /* compiled geometry object Id */
- pebblePoints, /* point dictionary */
- pebbleVertices, /* polygon descriptions */
- {0,0,0}, /* centroid */
- CALCIUM_COLOR, /* color */
- PEBBLE_TEXTURE, /* texture */
- FALSE, /* outlined */
- {0,0,0}, /* rotation */
- {-200,200,0}, /* translate */
- {0.8,0.8,1.0}, /* scale */
- 40, /* declasse */
- };
- model magnesium = {
- &calcium, /* next model segment */
- NULL, /* child model segments */
- NULL, /* geometry compiled yet? */
- (Object)&magnesium, /* compiled geometry object Id */
- pebblePoints, /* point dictionary */
- pebbleVertices, /* polygon descriptions */
- {0,0,0}, /* centroid */
- MAGNESIUM_COLOR, /* color */
- PEBBLE_TEXTURE, /* texture */
- FALSE, /* outlined */
- {0,0,0}, /* rotation */
- {50,250,0}, /* translate */
- {0.9,0.9,1.0}, /* scale */
- 63, /* declasse */
- };
- model phosphorous = {
- &magnesium, /* next model segment */
- NULL, /* child model segments */
- NULL, /* geometry compiled yet? */
- (Object)&phosphorous, /* compiled geometry object Id */
- pebblePoints, /* point dictionary */
- pebbleVertices, /* polygon descriptions */
- {0,0,0}, /* centroid */
- PHOSPHOR_COLOR, /* color */
- PEBBLE_TEXTURE, /* texture */
- FALSE, /* outlined */
- {0,0,0}, /* rotation */
- {250,50,0}, /* translate */
- {1.2,1.2,1.0}, /* scale */
- 70, /* declasse */
- };
- model granite = {
- &phosphorous, /* next model segment */
- NULL, /* child model segments */
- NULL, /* geometry compiled yet? */
- (Object)&granite, /* compiled geometry object Id */
- pebblePoints, /* point dictionary */
- pebbleVertices, /* polygon descriptions */
- {50,-200,0}, /* centroid */
- GRANITE_COLOR, /* color */
- PEBBLE_TEXTURE, /* texture */
- FALSE, /* outlined */
- {0,0,0}, /* rotation */
- {50,-200,0}, /* translate */
- {1.3,1.3,1.5}, /* scale */
- 77, /* declasse */
- };
- model mica = {
- &granite, /* next model segment */
- NULL, /* child model segments */
- NULL, /* geometry compiled yet? */
- (Object)&mica, /* compiled geometry object Id */
- pebblePoints, /* point dictionary */
- pebbleVertices, /* polygon descriptions */
- {-150,-50,0}, /* centroid */
- MICA_COLOR, /* color */
- PEBBLE_TEXTURE, /* texture */
- FALSE, /* outlined */
- {0,0,0}, /* rotation */
- {-150,-50,0}, /* translate */
- {1.3,1.3,1.5}, /* scale */
- 80, /* declasse */
- };
-
- model *stones[] = {
- &mica,
- &granite,
- &phosphorous,
- &magnesium,
- &calcium,
- };
-
-